#
#
#
#
#

CC=arm-linux-gcc#
LD=arm-linux-ld#
AR=arm-linux-ar#
AS=arm-linux-as#
ASFLAGS=-EL 
LDFLAGS=-g
ARFLAGS=-r
CFLAGS=-I ../srl_include -I ../srl_include/comm -I ../srl_include/drv -I ../srl_include/head -I ../srl_include/int -I ../srl_include/kernel

vpath %.h ../srl_include
vpath %.h ../srl_include/comm
vpath %.h ../srl_include/drv
vpath %.h ../srl_include/head
vpath %.h ../srl_include/int
vpath %.h ../srl_include/kernel

BUILD_DIR=../srl_build/obj
INT_TAG=int.a
INT_OBJ=inthw.o 
INT_SRC=$(INT_OBJ:.o=.c)
INT_DEP=$(INT_OBJ:.o=.d)
INT_ASSRC=kernel_asm_data_exp.s kernel_asm_fiq.s kernel_asm_instr_exp.s kernel_asm_irq.s kernel_asm_svc.s kernel_asm_und.s
INT_ASOBJ=int_asm.o

$(INT_TAG):$(INT_OBJ) $(INT_DEP) $(INT_ASOBJ)
	$(AR) $(ARFLAGS) -o $@ $(INT_OBJ) $(INT_ASOBJ)
	cp ./*.o $(BUILD_DIR)

$(INT_ASOBJ):$(INT_ASSRC)
	$(AS) $(ASFLAGS) $(INT_ASSRC) -o $@

dep:$(INT_DEP)
$(INT_DEP):%.d:%.c
	rm -f $*.d;\
	gcc $(CFLAGS) -MM $<|sed 's,^.*:,$*.o:,' >log.$$$$1;\
	echo $(CC) $(CFLAGS) -c $< -o $*.o >log.$$$$2;\
	cat log.$$$$1 log.$$$$2|sed 's/^$(CC)/\t$(CC)/g' >$@;\
	rm -f log.$$$$*;\

include $(INT_OBJ:.o=.d)

clean:
	rm -f $(INT_DEP) $(INT_OBJ) $(INT_TAG) $(INT_ASOBJ)
